﻿namespace XjjXmm.CodeGenerator
{


    public class NetControllerGeneratorStrangy : NetBaseGeneratorStrangy
    {
        public override dynamic GetTableModel(TableInfo table)
        {
            // table.PropertyName = GetTableName(table);

            return new
            {
                DbName = table.DbName,
                PropertyName = GetTableName(table),
                Description = table.Description,
                EntityName = GetEntityName(table),
                ModelName = GetModelName(table),
                ServiceName = GetServiceName(table),
            };
        }

        protected override string GetTableName(TableInfo table)
        {
            var res = base.ConverCamlName(table.DbName);

            return res + "Controller";
        }

        protected virtual string GetEntityName(TableInfo table)
        {
            var res = base.ConverCamlName(table.DbName);

            return res + "Entity";
        }

        protected virtual string GetModelName(TableInfo table)
        {
            var res = base.ConverCamlName(table.DbName);

            return res + "Model";
        }

        protected virtual string GetServiceName(TableInfo table)
        {
            var res = base.ConverCamlName(table.DbName);

            return "I" + res + "Service";
        }
    }

    
}
